package cn.com.roy.thread.t3_2_6.join_more_test;

public class ThreadA extends Thread {

    private ThreadB threadB  ;

    public ThreadA(ThreadB threadB ){
        this.threadB = threadB;
    }

    @Override
    synchronized public void run() {
        super.run();
        try {
            synchronized (threadB){
                System.out.println("begin A ThreadName = "+ currentThread().getName() + " " + System.currentTimeMillis()) ;
                Thread .sleep(5000);
                System.out.println("end A ThreadName = "+ currentThread().getName() + " " + System.currentTimeMillis()) ;
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
